package com.z2f.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class TokenConfig implements WebMvcConfigurer {
    @Autowired
    private TokenAuthInterceptor tokenAuthInterceptor;

    // 将自己的拦截器，加入到拦截器列表中
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // /**
        registry.addInterceptor(tokenAuthInterceptor).addPathPatterns("/**");
    }
}











